/**
 * Created by Chris on 2016/4/3.
 */
$(function () {

    // 淫贱的阻止页面选中效果
    document.onmousedown=function () {
        document.onmousemove=function () {
            window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
        }
    }
    document.onmouseup=function () {
        document.onmousemove = null;
    }


    var $container = $('.portfolio-items');
    setTimeout(function () {
        $container.isotope({
            itemSelector : '.portfolio-items > div',
            animationOptions: {
                duration: 750,
                easing: 'linear',
                queue: true
            }
        });
    },1000)

    project_info();




    $('#resume').fullpage({


            scrollingSpeed: 700,
            // 是否首尾相接
            //continuousVertical: true,
            normalScrollElementTouchThreshold: 5,
            // 导航条显示
            navigation: true,

            // 内容超出后是否出现滚动条
            scrollOverflow: false,
            // // 左右滑块循环
            loopHorizontal: false,
            // 导航栏设置
            anchors: ['page1','page2', 'page3', 'page4', 'page5', 'page6','page7','page8','page9','page10','page11','page12','page13','page14'],
            menu: '#menu',
            easing: 'easeInOut',

            // 页面渲染后回调
            afterRender: function () {

                // 顶部导航栏自动会拉事件
                if ($('.navbar-toggle').css('display') == 'block') {
                    $('.navbar-collapse li').on('click', function () {
                        $('.navbar-toggle').trigger('click');
                    });
                }


                $('#fp-nav').addClass('hidden-xs');
                // 为了避免标签太多同一时间加载的话在刚载入页面时候产生怪异感，所有动画元素初始都是hidden的
                setTimeout(function () {
                    $('.item-1 .corner' ).show();
                    $('.resume-hide').show();
                }, 500);
            },

            // 滚动触发后结束前回调
            onLeave: function (index, nextIndex, direction) {

                if(nextIndex==4){

                }

                if(nextIndex==6){
                    $('.sky').hide();
                }else {
                    $('.item-6 .top').animate({'height': '50%'},400);
                    $('.item-6 .foot').animate({'height': '50%'},400);
                }


                switch (index) {
                    case 1:
                        $('.item-15 .container15').hide();
                        break;

                    case 2:
                        $('.item-16 .container16').hide();
                        break;

                    case 3:
                        $('.item-17 .container17').hide();
                        break;

                    case 4:
                        $('.item-18 .container18').hide();
                        break;

                    case 5:
                        $('.item-19 .container19').hide();
                        break;
                }
            },

            // 滚动结束后回调
            afterLoad: function (anchorLink, index) {
                switch (anchorLink) {
                    case 'page1':
                        $('.item-15 .container15').show();
                        break;
                    case 'page2':
                        $('.item-16 .container16').show();
                        break;
                    case 'page3':
                        $('.item-17 .container17').show();
                        break;
                    case 'page4':
                        $('.item-18 .container18').show();
                        break;
                    case 'page5':
                        $('.item-19 .container19').show();
                        break;
                }
            },
        }
    )


})



